function count(str) {
    var arr = [];
    for (let i = 0; i < str.length; i++) {
        let index = arr.findIndex(v => v.value == str[i]);
        if (index < 0) {
            arr.push({ value: str[i], count: 1 })
        }else{
            arr[index].count++;
        }
    }
    return arr
}
console.log(count("123123456aaaa"));

function chong(arr){
    let set=new Set(arr);
    return set;
}
console.log(chong([1,2,3,1,2,"3","t","t","t","t"]));